//
// Created by cao on 19-10-26.
//
#include "detection_vision/utils.h"
#include "detection_vision/ctdetConfig.h"
#include <sstream>


Perf::Perf(const std::string& desc, float threshold) :
    description_(desc),
    threshold_(threshold),
    start_(std::chrono::system_clock::now())
{}
Perf::~Perf()
{
    std::chrono::duration<float> elapsed = std::chrono::system_clock::now() - start_;
    if(elapsed > threshold_)
    {
        std::cout<<description_<<" cost: "<<elapsed.count()<<" s"<<std::endl;
    }
}


